// component/super_brand/super_brand.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    api_host: {
      type: String
    },
    name: {
      type: String,
      value: '超级品牌周'
    },
    list: {
      type: Array
    },
    wxapp_img: {
      type: Object
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    brand: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    bindroll(e) {
      this.setData({
        flag:true
      })
    },
    cut() {
      if (this.data.brand == this.data.list.length - 1) {
        this.setData({
          brand: 0,
          flag: false
        })
      } else {
        this.setData({
          brand: this.data.brand + 1,
          flag: false
        })
      }
    },
    changeIndex: function (e) {
      this.setData({
        brand: e.detail.current
      })
    },
    goToGoods: function (e) {
      var id = e.currentTarget.dataset.id;
      wx.navigateTo({
        url: '/pages/goods/goods?id=' + id,
      })
    }
  }
})